package com.apes.enquiry.enquiry.model;

import com.apes.framework.jpa.BaseModel;
import com.apes.framework.jpa.DefaultPersistListener;
import com.apes.framework.jpa.comment.Comment;
import com.apes.framework.jpa.generator.ApesGenerator;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.SelectBeforeUpdate;

import javax.persistence.*;

/**
 * 类描述：报价配件明细
 *
 * @ClassName QuoteItem
 * @Description 描述
 * @Author wushilong
 * @Date 2023/3/16 9:29
 * @Version 1.0
 */

@Getter
@Setter
@SelectBeforeUpdate
@DynamicInsert
@DynamicUpdate
@Entity
@EntityListeners(DefaultPersistListener.class)
@Table(name = QuoteItem.CONST_TABLE_NAME)
public class QuoteItem extends BaseModel {

    public static final String CONST_TABLE_NAME = "sp_mas_quote_item";

    @Id
    @Column(name = "id", length = 10)
    @ApesGenerator(code = CONST_TABLE_NAME, name = "报价配件", padding = 8)
    @Comment("编码")
    private String id;

    @Column(name = "party_Role_Id", length = 32, nullable = false)
    @Comment("供应商id")
    private String partyRoleId;

    @Column(name = "quote_id", length = 32, nullable = false)
    @Comment("报价单id")
    private String quoteId;

    @Column(name = "enquiry_require_id", length = 32, nullable = false)
    @Comment("询价需求")
    private String enquiryRequireId;

    @Column(name = "enquiry_item_id", length = 32, nullable = false)
    @Comment("询价配件")
    private String enquiryItemId;

    @Column(name = "quote_state", length = 32, nullable = false)
    @Comment("报价状态")
    private String quoteState;//not(未报价), already(已报价), lack(缺货)

    @Column(name = "recognition_state", length = 32, nullable = false)
    @Comment("识别状态")
    private String recognitionState;//not(未识别), already(已识别), cannot(无法识别)

    @Column(name = "original_quote_qty", length = 32)
    @Comment("原厂件报价SKU数")
    private Integer originalQuoteQty;

    @Column(name = "brand_quote_qty", length = 32)
    @Comment("品牌件报价SKU数")
    private Integer brandQuoteQty;

    @Column(name = "same_quote_qty", length = 32)
    @Comment("同质件报价SKU数")
    private Integer sameQuoteQty;

    @Column(name = "else_quote_qty", length = 32)
    @Comment("其他件报价SKU数")
    private Integer elseQuoteQty;
}
